#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <stdlib.h>
int a[5];
int compare(const void *a, const void *b) {
    return (*(int*)a - *(int*)b);  // 比较两个整数
}
int main() {
    int x;
    int k = 0;
    while(scanf("%d", &x) == 1) {
        a[k++] = x;
    }
    switch (k) {
        case 1:
            printf("One card");
            break;
        case 2:
            if(a[0] == a[1]) {
                printf("Pair");
            }else {
                printf("Not a hand of cards");
            }
            break;
        case 3:
            if(a[0] == a[1] && a[1] == a[2]) {
                printf("Three cards");
            }else {
                printf("Not a hand of cards");
            }
            break;
        case 4:
            qsort(a, k, sizeof(int), compare);
            if(a[0] == a[1] && a[1] == a[2] && a[2] == a[3] && a[3] == a[4]) {
                printf("Bomb");
            }else if((a[0] == a[1] && a[1] == a[2]) || (a[2] == a[3] && a[3] == a[4])) {
                printf("Three and one");
            }else if(a[0] == a[1] && a[2] == a[3]) {
                printf("Two pairs");
            }else {
                printf("Not a hand of cards");
            }
            break;
    }
    return 0;
}